<template>
  <div class="maintainArea">
    <ws-table :columns="tableColumns"
              :operation="operation"
              url="post|/basicParameter/maintainArea/listAll"
              @handleEdit="handleEdit"
    >
      <template #opera="{row, index}">
        <el-button link type="danger" @click="handleDelete(row, index)">删除</el-button>
      </template>
    </ws-table>
  </div>
</template>

<script setup>
defineOptions({
  name: 'basicParameter_maintainArea'
})
const state = reactive({
  tableColumns: [
    { label: '片区编号', prop: 'areaId' },
    { label: '片区名称', prop: 'areaName' },
    { label: '辖区划分', prop: 'jurisdictionName', sortable: false },
    { label: '片区描述', prop: 'areaDesc' }
  ],
  operation: {
    width: 120,
    data: [
      { label: '编辑', type: 'primary', handle: 'edit' }
    ]
  }
})
const { tableColumns, operation } = toRefs(state)
const handleEdit = (row, index) => {
  console.log(index, row)
}
const handleDelete = (row, index) => {
  console.log(index, row)
}
</script>

<style lang="scss" scoped>
.maintainArea {
  width: 100%;
  height: 100%;
  position: relative;
}
</style>
